package com.hn.kiss.modules.sys.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hn.kiss.config.validdator.FlagValidator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 菜单表
 * </p>
 *
 * @author zxy
 * @since 2020-08-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_menu")
@ApiModel(value="Menu对象", description="菜单表")
public class Menu implements Serializable {

    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "id")
    @TableField(fill = FieldFill.INSERT)
    private String id;

    @ApiModelProperty(value = "父菜单id(一级菜单的父菜单id是菜单类别)", required = true)
    @NotBlank
    private String parentId;

    @ApiModelProperty(value = "路径")
    private String url;

    @ApiModelProperty(value = "菜单名称", required = true)
    @NotBlank
    private String name;

    @ApiModelProperty(value = "图标")
    private String icon;

    @ApiModelProperty(value = "排序号", required = true)
    @NotNull
    private Integer orderNo;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createDate;

    @ApiModelProperty(value = "菜单最新修改时间")
    @TableField(fill = FieldFill.UPDATE)
    private Date modifyDate;

    @ApiModelProperty(value = "类别(1:菜单,2:按钮)", required = true)
    @FlagValidator(value = {"1", "2"})
    @NotBlank
    private String type;



}
